package com.yurun.loginmodule.mapper;

import com.yurun.commonapi.pojo.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface PermissionMapper {
    /**
     * 根据权限id获取权限
     */
    List<Permission> getPermissionList(int adminId);

    /**
     * 根据角色id获取权限id
     */
    List<Integer>  getPermissionByRole(int roleId);

    /**
     * 获取所有权限
     */
    List<Permission> getAllPermission();

    /**
     * 获取单个权限
     */
    String getPermission(String username);

    List<Integer> getAdminAllPermission(int categoryId);

    int addPermissionByCategory(@Param("roleId") int roleId, @Param("resourceId") int resourceId);

    List<String> getPermissionName(int roleId);
}
